package com.ntschy.common.core.entity.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author ezreal_geng
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SysBusinessType implements IEnum<Integer> {
    YJQZ(0, "一键求助"),
    ZCK(1, "政策哭"),
    GXCS(2, "供需超市"),
    WJDC(3, "问卷调查"),
    ZXSB(4, "专项申报"),
    ZGTS(5, "工作推送"),
    QYFC(6, "企业风采"),
    QYDSJFX(7, "企业大数据分析");

    private final int value;

    //@JsonValue
    private final String desc;

    SysBusinessType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static SysBusinessType getBusinessTypeFromValue(int value) {
        for (SysBusinessType businessType : SysBusinessType.values()) {
            if(businessType.getValue() == value) {
                return businessType;
            }
        }
        return null;
    }
}

